local huchou = fk.CreateSkill {
  name = "huchou",
  tags={Skill.Compulsory},
}

huchou:addEffect(fk.DamageInflicted, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return data.from and data.from == player and player:getMark(self.name) == target.id
  end,
  on_use = function(self, event, target, player, data)
    data.damage = data.damage + 1
  end,
})
huchou:addEffect(fk.TargetConfirmed, {
  can_refresh = function(self, event, target, player, data)
    return target == player and player:hasSkill(self, true) and
      data.card.is_damage_card and data.from ~= player and player:getMark(self.name) ~= data.from.id
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player, self.name, data.from.id)
    room:setPlayerMark(player, "@huchou", data.from.general)
  end,

  on_acquire = function (self, player, is_start)
    local room = player.room
    room.logic:getEventsOfScope(GameEvent.UseCard, 1, function (e)
      local use = e.data
      if use.tos and table.contains(use.tos, player) and
        use.card.is_damage_card and use.from ~= player then
        room:setPlayerMark(player, self.name, use.from.id)
        room:setPlayerMark(player, "@huchou", use.from.general)
        return true
      end
    end, Player.HistoryGame)
  end,
})
return huchou